package net.mingsoft.message_center.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * @author gengfa
 * @date 22/02/07
 */
public enum MessageType {

    /**
     * 操作类型：类型：'PUB_REQUEST' 发布申请、'STAR_WATCH' 收藏监控、'SHARE'共享通知
     */
    PUB_REQUEST("PUB_REQUEST", "发布申请"),
    STAR_WATCH("STAR_WATCH", "收藏监控"),
    SHARE("SHARE", "共享通知"),
    UNKNOWN("UNKNOWN", "未知");

    private String type;

    private String desc;

    MessageType(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static String getDesc(String type) {
        for (MessageType value : MessageType.values()) {
            if (StringUtils.equals(value.getType(), type)) {
                return value.getDesc();
            }
        }
        return MessageType.UNKNOWN.getDesc();
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
